package cn.edu.wfit.modules.infomanagement.service.impl;

import java.util.List;
import cn.edu.wfit.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.edu.wfit.modules.infomanagement.mapper.DormbuildingMapper;
import cn.edu.wfit.modules.infomanagement.domain.Dormbuilding;
import cn.edu.wfit.modules.infomanagement.service.IDormbuildingService;

/**
 * 书院维护Service业务层处理
 * 
 * @author 韩强
 * @date 2024-11-18
 */
@Service
public class DormbuildingServiceImpl implements IDormbuildingService 
{
    @Autowired
    private DormbuildingMapper dormbuildingMapper;

    /**
     * 查询书院维护
     * 
     * @param dormbuildingId 书院维护主键
     * @return 书院维护
     */
    @Override
    public Dormbuilding selectDormbuildingByDormbuildingId(Long dormbuildingId)
    {
        return dormbuildingMapper.selectDormbuildingByDormbuildingId(dormbuildingId);
    }

    /**
     * 查询书院维护列表
     * 
     * @param dormbuilding 书院维护
     * @return 书院维护
     */
    @Override
    public List<Dormbuilding> selectDormbuildingList(Dormbuilding dormbuilding)
    {
        return dormbuildingMapper.selectDormbuildingList(dormbuilding);
    }

    /**
     * 新增书院维护
     * 
     * @param dormbuilding 书院维护
     * @return 结果
     */
    @Override
    public int insertDormbuilding(Dormbuilding dormbuilding)
    {
        dormbuilding.setCreateTime(DateUtils.getNowDate());
        return dormbuildingMapper.insertDormbuilding(dormbuilding);
    }

    /**
     * 修改书院维护
     * 
     * @param dormbuilding 书院维护
     * @return 结果
     */
    @Override
    public int updateDormbuilding(Dormbuilding dormbuilding)
    {
        dormbuilding.setUpdateTime(DateUtils.getNowDate());
        return dormbuildingMapper.updateDormbuilding(dormbuilding);
    }

    /**
     * 批量删除书院维护
     * 
     * @param dormbuildingIds 需要删除的书院维护主键
     * @return 结果
     */
    @Override
    public int deleteDormbuildingByDormbuildingIds(Long[] dormbuildingIds)
    {
        return dormbuildingMapper.deleteDormbuildingByDormbuildingIds(dormbuildingIds);
    }

    /**
     * 删除书院维护信息
     * 
     * @param dormbuildingId 书院维护主键
     * @return 结果
     */
    @Override
    public int deleteDormbuildingByDormbuildingId(Long dormbuildingId)
    {
        return dormbuildingMapper.deleteDormbuildingByDormbuildingId(dormbuildingId);
    }
}
